//
//  Utilities.h
//  ZYD
//
//  Created by chenxin on 16/3/10.
//  Copyright © 2016年 Chinaj. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Utilities : NSObject

//16进制颜色转换UIColor
+ (UIColor *)colorWithHexString:(NSString *)color;

#pragma mark - 自定义圆形图片
+ (UIImage *)customCircularPNGWithWord:(NSString *)word size:(CGSize)size;
+ (UIImage *)customCircularPNGWithWord:(NSString *)word size:(CGSize)size withFontsize:(CGFloat)fontSize;

#pragma mark - 取消searchbar背景色
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;

#pragma mark - 判断字符串是否为空
+ (BOOL)isEmpty:(NSString *)string;

#pragma mark - 将nil、NSNull转成空字符串
+ (NSString *)safeString:(NSString *)string;

#pragma mark - 判断手机号码
+ (BOOL)checkTelephoneNumber:(NSString*)number;

#pragma mark - 验证邮箱
+ (BOOL)validateEmail:(NSString *)email;

#pragma mark - 验证密码
+ (BOOL)validatePassword:(NSString *)password;

#pragma mark - 计算label的高度
+ (CGSize)boundingRectWithSize:(CGSize)size font:(UIFont *)font string:(NSString *)textStr;

#pragma mark - 时间转为yyyyMMddHHMMss
+ (NSString *)dateConverString;

#pragma mark - 两个NSDate相减
+ (NSTimeInterval)twoDateSub:(NSDate *)beginDate andEndDate:(NSDate *)endDate;

#pragma mark - Base64 ->UIImage
+ (UIImage *)base64CovertToUIImage:(NSString *)base64;

#pragma mark - NSDictionary -> Json String
+ (NSString*)dataTOjsonString:(id)object;

#pragma mark - 清除 webCache
+ (void)deleteWebCache;

#pragma mark - 跳转AppStore
+ (void)skipToAppstore:(NSString *)storeUrl;

#pragma mark - 强制闪退
+ (void)makeCrash;

#pragma mark - 返回跳转的地址
+ (NSString *)getPushUrlFrom:(NSString *)string suffixString:(NSString *)suffixStr;

#pragma mark - UserAgent
+ (void)setUserAgent:(NSString *)userAgentContent;

#pragma mark - Tips 新手指引
+ (void)canShowTipsGuideView:(void(^)(void))show;

#pragma mark - 获取当前时间戳 （以毫秒为单位）
+(NSString *)getNowTimeTimestamp3;

@end
